package com.minio.miniospringboot.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;

/**
 * @ClassName: Knife4jConfiguration
 * @Desc: TODO
 * @author: <Bang>
 * @Date: 2021/12/17 10:51
 * @Version: 1.0
 * @Modified By:
 */
@Configuration
@EnableSwagger2WebMvc
public class Knife4jConfiguration {

    @Bean(value = "defaultApi2")
    public Docket defaultApi2() {
        return new Docket(DocumentationType.SWAGGER_2)
                .apiInfo(new ApiInfoBuilder()
                        .description("minio restful api")
                        .version("1.0")
                        .build())
                .groupName("2.X版本")
                .select()
                .apis(RequestHandlerSelectors.basePackage("com.minio"))
                .paths(PathSelectors.any())
                .build();
    }


}
